{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Reaction Names\n",
    "\n",
    "This demonstrates how the rxname module may be used to find and manipulate the PyNE cannonical reaction names."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pyne.rxname import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "total\n",
      "p\n",
      "absorption\n"
     ]
    }
   ],
   "source": [
    "print(name(\"total\"))\n",
    "print(name(103))    # MT number for proton production\n",
    "print(name(\"abs\"))  # an abbreviation for absorption"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Each reaction name has a unique id number"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1313192322\n",
      "1104\n",
      "3163131457\n"
     ]
    }
   ],
   "source": [
    "print(id(\"total\"))\n",
    "print(id(103))    # MT number for proton\n",
    "print(id(\"abs\"))  # an abbreviation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Each reaction also has labels and documentation strings"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(z,p)\n",
      "(z,p) Production of p\n"
     ]
    }
   ],
   "source": [
    "print(label('p'))\n",
    "print(doc('p'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Where possible, MT numbers may be looked up."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2\n",
      "103\n"
     ]
    }
   ],
   "source": [
    "print(mt('elastic'))\n",
    "print(mt('p'))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Finally, nuclides themselves may also be used to look up reactions."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "absorption\n",
      "absorption\n",
      "p\n"
     ]
    }
   ],
   "source": [
    "print(name(\"U235\", \"U236\"))\n",
    "print(name(\"U235\", \"Np236\", \"p\"))\n",
    "print(name(922350, 912350))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
